/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package data.model;

/**
 *
 * @author zhenia
 */
public class Route implements Comparable<Route> {

    private String id;
    private int frequency;
    private double rating;
    private int weeklyPassengers;
    private Airport departureAirport;
    private Airport arrivalAirport;

    public Route(String id, int frequency, double rating, int weeklyPassengers, Airport departureAirport, Airport arrivalAirport) {
        this.id = id;
        this.frequency = frequency;
        this.rating = rating;
        this.weeklyPassengers = weeklyPassengers;
        this.departureAirport = departureAirport;
        this.arrivalAirport = arrivalAirport;
    }

    public Route() {
    }

    public Airport getArrivalAirport() {
        return arrivalAirport;
    }

    public void setArrivalAirport(Airport arrivalAirport) {
        this.arrivalAirport = arrivalAirport;
    }

    public Airport getDepartureAirport() {
        return departureAirport;
    }

    public void setDepartureAirport(Airport departureAirport) {
        this.departureAirport = departureAirport;
    }

    public int getFrequency() {
        return frequency;
    }

    public void setFrequency(int frequency) {
        this.frequency = frequency;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public double getRating() {
        return rating;
    }

    public void setRating(double rating) {
        this.rating = rating;
    }

    public int getWeeklyPassengers() {
        return weeklyPassengers;
    }

    public void setWeeklyPassengers(int weeklyPassengers) {
        this.weeklyPassengers = weeklyPassengers;
    }

    @Override
    public String toString() {
        return departureAirport.getName() + " - " + arrivalAirport.getName();
    }

    @Override
    public int compareTo(Route t) {
        return (int) (t.getRating()-rating);        
    }
}
